<?php
/**
 * Created by PhpStorm.
 * User: dayu
 * Date: 2019/12/23
 * Time: 16:36
 */

use think\Route;


Route::group(["name" => "api", 'prefix' => 'api/'], function () {

    //令牌刷新
    Route::post("disposeToken", "Login/disposeToken");
    Route::get("address", "Login/address");

    //支付回调
    Route::post("NotifyUrl", "Wx/NotifyUrl");

    Route::group(["name" => "wx",], function () {
        //登录
        Route::post("Login", "Login/index");
        Route::post("openId", "Login/openId");
    });


    Route::group(["name" => "wx"], function () {
        //登录
        Route::post("Login", "Login/index");
        //微信手机号获取
        Route::post("decodePhone", "Login/decodePhone");

        //支付
        Route::post("pay", "Wx/JsApiPay");
    });
    Route::group(["name" => "wx"], function () {
        //登录
        Route::post("Login", "Login/index");
        Route::post("pay", "Wx/JsApiPay");
    });
    Route::group(['before_behavior' => "\app\api\Before"], function () {

        //商品
        Route::group(["name" => "Goods"], function () {

            //商品分类
            Route::post("goodsCategoryList", "Goods/goodsCategoryList");

            //首页3大分类商品列表
            Route::post("HomeGoodsList", "Goods/HomeGoodsList");

            //自定义分类列表
            Route::post("VarietyList", "Goods/VarietyList");

            //自定义分类集合
            Route::post("VarietyGather", "Goods/VarietyGather");

            //猜你喜欢
            Route::post("getGuessMemberLikes", "Goods/getGuessMemberLikes");

            //商品信息获取
            Route::post("getGoodsInfo", "Goods/getGoodsInfo");
            //商品信息获取
            Route::get("goodsVariety", "Goods/goodsVariety");
            //订单创建
            Route::post("createGoodsOrder", "Goods/createGoodsOrder");
            //内购商品
            Route::get("purchasing", "Goods/purchasing");
            //热门推荐
            Route::get("PopularRecommend", "Goods/PopularRecommend");
            //分类商品列表
            Route::post("RecommendGoods", "Goods/RecommendGoods");

            //品牌名列表
            Route::get("GoodsBrand", "Goods/GoodsBrand");

            //购物车添加
            Route::post("addCart", "Goods/addCart");
            //购物车修改
            Route::post("cartAdjustNum", "Goods/cartAdjustNum");
            //购物车删除
            Route::post("cartDelete", "Goods/cartDelete");
            //查看购物车
            Route::post("getShoppingCart", "Goods/getShoppingCart");
        });

        //活动
        Route::group(["name" => "Activity"], function () {

            //限时购列表
            Route::post("discountList", "Activity/discountList");
            //限时购列表
            Route::post("purchase", "Activity/purchase");
            //拼团列表
            Route::post("tuangouList", "Tuangou/tuangouList");
            //活动报名
            Route::post("activityRregistration", "Tuangou/activityRregistration");
            //领取优惠券
            Route::post("getCoupon", "Activity/getCoupon");
            //拼团列表
            Route::post("partnershipSpell", "Tuangou/partnershipSpell");
            //拼团人数查询
            Route::post("participantsNumber", "Tuangou/participantsNumber");
            //拼团集合
            Route::get("tuangouGather", "Tuangou/tuangouGather");


        });

        //会员
        Route::group(["name" => "Member"], function () {

            //验证码发送
            Route::post("verificationCode", "Send/verificationCode");

            //获取地区
            Route::post("getArea", "City/getArea");
            //获取省份
            Route::post("getProvince", "City/getProvince");
            //获取城市
            Route::post("getCity", "City/getCity");
            //获取区域
            Route::post("getDistrict", "City/getDistrict");

            //会员
            //地区添加
            Route::post("addressInsert", "MemberShip/addressInsert");
            //设置默认地址
            Route::post("updateAddressDefault", "MemberShip/updateAddressDefault");
            //删除地址
            Route::post("deleteMemberAddress", "MemberShip/deleteMemberAddress");
            //地区列表
            Route::post("addressList", "MemberShip/addressList");
            //修改地区
            Route::post("updateMemberAddress", "MemberShip/updateMemberAddress");
            //地址详情
            Route::post("getAddressInfo", "MemberShip/getAddressInfo");

            //个人信息
            Route::get("userInfo", "MemberShip/userInfo");


        });

        //入驻
        Route::group(["name" => "Index"], function () {
            //企业入驻
            Route::post("settledIn", "Index/settledIn");
            //创客入驻
            Route::post("ckSettledIn", "Index/ckSettledIn");


            //修改密码
            Route::post("updateUserPasswordByPassword", "Index/updateUserPasswordByPassword");
            //修改密码
            Route::post("forgetPassword", "Index/forgetPassword");

        });

        //亲友卡
        Route::group(["name" => "Family"], function () {
            //亲友卡
            //购买亲友卡
            Route::post("purchaseFamilyCard", "Family/purchaseFamilyCard");
            Route::post("getPayInfo", "Family/getPayInfo");

            //获取个人的亲友卡
            Route::post("getPersonalFamilyCard", "Family/getPersonalFamilyCard");

            //获取亲友卡列表   经典  和  精选
            Route::post("getClassicFamilyCardList", "Family/getClassicFamilyCardList");
            Route::post("getSelectedFamilyCardList", "Family/getSelectedFamilyCardList");

            //我的亲友卡
            Route::post("myFamily", "Family/myFamily");

            //亲友卡记录接口
            Route::post("familyRecords", "Family/familyRecords");

            //获取分享详情
            Route::post("getShareInfo", "Family/getShareInfo");
            //处理分享成功
            Route::post("handleShare", "Family/handleShare");

            //唤起支付信息
            Route::post("getPayWxInfo", "Family/getPayWxInfo");

            //清理过期购买亲友卡订单
            Route::post("updateOrder", "Family/updateOrder");

        });

        Route::group(["name" => "Order"], function () {
            //订单列表
            Route::post("orderList", "Order/orderList");
            //订单详情
            Route::post("orderInfo", "Order/orderInfo");

        });

        //广告
        Route::group(["name" => "Ad"], function () {
            //获取移动端所有广告位
            Route::post("adList", "Config/adList");
            //获取广告详情
            Route::post("adInfo", "Config/adInfo");
            //获取该页广告
            Route::post("adLocalList", "Config/adLocalList");

        });


    });

    Route::miss(function () {
        return json_encode(return_json_data("请求方式错误或接口不存在", 500));
    });
});

